package apps.softtech.fastmarket.model;

import android.content.ContentValues;
import android.database.Cursor;

public class FollowUser {

	public static final String TABLE_NAME = "FollowUser";

	public static final String FOLLOW_ID = "st_FollowId";
	private int followId;

	public static final String FROM_USER_ID = "st_FromUserId";
	private int fromUserId;

	public static final String TO_USER_ID = "st_ToUserId";
	private int toUserId;

	public static final String FOLLOW_DATE = "st_FollowDate";
	private String followDate;

	public static final String GET_NOTIFICATION = "st_GetNotification";
	private int getNotification;

	public static final String UNFOLLOW = "st_Unfollow";
	private int unFollow;

	public FollowUser(int followId, int fromUserId, int toUserId,
			String followDate, int getNotification) {
		super();
		this.followId = followId;
		this.fromUserId = fromUserId;
		this.toUserId = toUserId;
		this.followDate = followDate;
		this.getNotification = getNotification;
	}

	public FollowUser() {
		super();
	}

	public FollowUser(int fromUserId, int toUserId, String followDate,
			int getNotification) {
		super();
		this.fromUserId = fromUserId;
		this.toUserId = toUserId;
		this.followDate = followDate;
		this.getNotification = getNotification;
	}

	/**
	 * get value of FollowUser
	 * 
	 * @return ContentValues
	 */
	public ContentValues getValueFollowUser() {
		ContentValues values = new ContentValues();
		values.put(FROM_USER_ID, this.getFromUserId());
		values.put(TO_USER_ID, this.getToUserId());
		values.put(FOLLOW_DATE, this.getFollowDate());
		values.put(GET_NOTIFICATION, this.getGetNotification());
		return values;
	}

	public void setValueFromCursor(Cursor c) {

		if (c.getColumnIndex(FROM_USER_ID) >= 0) {
			setFromUserId(c.getInt(c.getColumnIndex(FROM_USER_ID)));
		}
		if (c.getColumnIndex(TO_USER_ID) >= 0) {
			setToUserId(c.getInt(c.getColumnIndex(TO_USER_ID)));
		}
		if (c.getColumnIndex(FOLLOW_DATE) >= 0) {
			setFollowDate(c.getString(c.getColumnIndex(FOLLOW_DATE)));
		}
		if (c.getColumnIndex(GET_NOTIFICATION) >= 0) {
			setGetNotification(c.getInt(c.getColumnIndex(GET_NOTIFICATION)));
		}
	}

	public int getUnFollow() {
		return unFollow;
	}

	public void setUnFollow(int unFollow) {
		this.unFollow = unFollow;
	}

	public int getFollowId() {
		return followId;
	}

	public void setFollowId(int followId) {
		this.followId = followId;
	}

	public int getFromUserId() {
		return fromUserId;
	}

	public void setFromUserId(int fromUserId) {
		this.fromUserId = fromUserId;
	}

	public int getToUserId() {
		return toUserId;
	}

	public void setToUserId(int toUserId) {
		this.toUserId = toUserId;
	}

	public String getFollowDate() {
		return followDate;
	}

	public void setFollowDate(String followDate) {
		this.followDate = followDate;
	}

	public int getGetNotification() {
		return getNotification;
	}

	public void setGetNotification(int getNotification) {
		this.getNotification = getNotification;
	}

}
